package cn.edu.bs.domain;

import java.io.Serializable;
import java.util.Date;

public class Borrow implements Serializable {
    private Integer borrowId;

    private Integer userId;

    private Integer bookId;

    private Date borrowTime;

    private Boolean isReturn;

    private Boolean isUrged;

    private static final long serialVersionUID = 1L;

    public Borrow(Integer borrowId, Integer userId, Integer bookId, Date borrowTime, Boolean isReturn, Boolean isUrged) {
        this.borrowId = borrowId;
        this.userId = userId;
        this.bookId = bookId;
        this.borrowTime = borrowTime;
        this.isReturn = isReturn;
        this.isUrged = isUrged;
    }

    public Borrow() {
        super();
    }

    public Integer getBorrowId() {
        return borrowId;
    }

    public void setBorrowId(Integer borrowId) {
        this.borrowId = borrowId;
    }

    public Integer getUserId() {
        return userId;
    }

    public void setUserId(Integer userId) {
        this.userId = userId;
    }

    public Integer getBookId() {
        return bookId;
    }

    public void setBookId(Integer bookId) {
        this.bookId = bookId;
    }

    public Date getBorrowTime() {
        return borrowTime;
    }

    public void setBorrowTime(Date borrowTime) {
        this.borrowTime = borrowTime;
    }

    public Boolean getIsReturn() {
        return isReturn;
    }

    public void setIsReturn(Boolean isReturn) {
        this.isReturn = isReturn;
    }

    public Boolean getIsUrged() {
        return isUrged;
    }

    public void setIsUrged(Boolean isUrged) {
        this.isUrged = isUrged;
    }

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        Borrow other = (Borrow) that;
        return (this.getBorrowId() == null ? other.getBorrowId() == null : this.getBorrowId().equals(other.getBorrowId()))
            && (this.getUserId() == null ? other.getUserId() == null : this.getUserId().equals(other.getUserId()))
            && (this.getBookId() == null ? other.getBookId() == null : this.getBookId().equals(other.getBookId()))
            && (this.getBorrowTime() == null ? other.getBorrowTime() == null : this.getBorrowTime().equals(other.getBorrowTime()))
            && (this.getIsReturn() == null ? other.getIsReturn() == null : this.getIsReturn().equals(other.getIsReturn()))
            && (this.getIsUrged() == null ? other.getIsUrged() == null : this.getIsUrged().equals(other.getIsUrged()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getBorrowId() == null) ? 0 : getBorrowId().hashCode());
        result = prime * result + ((getUserId() == null) ? 0 : getUserId().hashCode());
        result = prime * result + ((getBookId() == null) ? 0 : getBookId().hashCode());
        result = prime * result + ((getBorrowTime() == null) ? 0 : getBorrowTime().hashCode());
        result = prime * result + ((getIsReturn() == null) ? 0 : getIsReturn().hashCode());
        result = prime * result + ((getIsUrged() == null) ? 0 : getIsUrged().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", borrowId=").append(borrowId);
        sb.append(", userId=").append(userId);
        sb.append(", bookId=").append(bookId);
        sb.append(", borrowTime=").append(borrowTime);
        sb.append(", isReturn=").append(isReturn);
        sb.append(", isUrged=").append(isUrged);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}